package com.edu.java;



/*
* 初始化测试
* */

public class ClassClinitTest {

    private static int num = 1;

    static {

        num = 2;
        number = 20;
        System.out.println(num);
        // System.out.println(number);  // 报错：非法的前向引用
    }


    private static int number = 10;  // linking之prepare : number = 0 ---> initial：20  ---> 10

    public static void main(String[] args) {

        System.out.println(ClassClinitTest.num);  // 2
        System.out.println(ClassClinitTest.number);   // 10

    }
}
